<template>
  <div class="portfolio">
    <h1>作品展示</h1>
    <div class="projects-grid">
      <div class="project-card" v-for="project in projects" :key="project.id">
        <img :src="project.image" :alt="project.title">
        <div class="project-info">
          <h3>{{ project.title }}</h3>
          <p>{{ project.description }}</p>
          <span class="project-tag">{{ project.tech }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
const projects = [
  {
    id: 1,
    title: '电商平台',
    description: '基于Vue3开发的现代化电商平台',
    tech: 'Vue3 + Vite',
    image: 'https://picsum.photos/300/200?random=3'
  },
  {
    id: 2,
    title: '数据看板',
    description: '实时数据可视化分析系统',
    tech: 'React + D3.js',
    image: 'https://picsum.photos/300/200?random=4'
  },
  {
    id: 3,
    title: '移动应用',
    description: '跨平台移动应用开发',
    tech: 'Flutter',
    image: 'https://picsum.photos/300/200?random=5'
  }
]
</script>

<style scoped>
.portfolio {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.portfolio h1 {
  text-align: center;
  margin-bottom: 3rem;
  color: #2c3e50;
  font-size: 2.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.project-info p {
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tag {
  background: #3498db;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .portfolio h1 {
    font-size: 2rem;
  }
}
</style>